<?php
	//include ("lib/DataProvider.php");

	if(isset($_GET['id']) == true)
		$id = $_GET['id'];
	else
		$id = 1;
?>

<?php
                    $sql = "SELECT * FROM Sach WHERE BiXoa = 0 AND MaSach = $id";
                    $result = DataProvider::ExecuteQuery($sql);
                    $row = mysql_fetch_array($result);
                    //echo $id;

?>
                <div class="box-bookdetail">
                    <div class="row">
                        <div class="span3">
                            <img src="<?php echo $row["HinhURL"]; ?>" border="0" alt="<?php echo $row["TenSach"]; ?>" title="<?php echo $row["TenSach"]; ?>">
                        </div>
                        <div class="span5">
                            <h3><?php echo $row["TenSach"]; ?></h3>
                            <!-- <h4 class="book-pricetext">94.000 đ</h4> -->
                            <button id="btnAdd" bookid="438" type="button" class="btn"><i class="icon-shopping-cart"></i> Đặt mượn</button>

                            <dl class="dl-horizontal">
                                <dt>Tác giả</dt>
                                <dd><?php echo $row["TacGia"]; ?></dd>
                                <dt>Ngày đăng</dt>
                                <dd><?php echo $row["NgayDangSach"]; ?></dd>
                                <dt>Số lượng tồn</dt>
                                <dd><?php echo $row["SoLuongTon"]; ?></dd>
                                <dt>Thể loại</dt>
                                <dd>
                                	<?php
                                	$loaisach = $row["MaLoaiSach"];
                                	$sql2 = "SELECT * FROM loaisach WHERE BiXoa = 0 AND MaLoaiSach = $loaisach";
				                    $result2 = DataProvider::ExecuteQuery($sql2);
				                    $row2 = mysql_fetch_array($result2);

                                	echo $row2["TenLoaiSach"];
                                	?>
                                	--
                                	<?php
                                	$loaisach = $row["MaChiTietLoaiSach"];
                                	$sql3 = "SELECT * FROM ChiTietLoaiSach WHERE BiXoa = 0 AND MaChiTietLoaiSach = $loaisach";
				                    $result3 = DataProvider::ExecuteQuery($sql3);
				                    $row3 = mysql_fetch_array($result3);

                                	echo $row3["TenChiTietLoaiSach"];
                                	?>
                                </dd>

                            </dl>
                        </div>
                    </div>
                    <div class="margin-top20">
                        <div class="tabbable">
                            <ul class="nav nav-tabs">
                                <li class="active"><a href="#tab1" data-toggle="tab">Giới thiệu sách</a></li>
                            </ul>
                            <div class="tab-content">
                                <div class="tab-pane active" id="tab1">
                                    <p style="outline:none medium;box-sizing:border-box;margin-top:0px;margin-bottom:10px;color:#444444;font-family:Arial, Helvetica, sans-serif;font-size:14px;line-height:21px;white-space:normal;background-color:#FFFFFF;">
										<?php echo $row["MoTa"]; ?>
									</p>
                                </div>

                            </div>
                        </div>

                    </div>
                    <div class="gap"></div>
                </div>
